package com.ruoyi.datastatistics.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.datastatistics.domain.RealtimegatherdataXb;
import com.ruoyi.datastatistics.vo.XbDatabase;
import com.ruoyi.datastatistics.vo.XbDatabaseVO;
import com.ruoyi.datastatistics.wxentity.WXRealtimegatherdataXb;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 实时数据采集（小）Mapper接口
 *
 * @author ruoyi
 * @date 2023-09-07
 */
public interface RealtimegatherdataXbMapper extends BaseMapper<RealtimegatherdataXb>
{
    /**
     * 查询户表基本信息和实时数据
     *
     * @param req 户表信息查询集合
     */
    public List<XbDatabase> basedataXb(XbDatabaseVO req);

    /**
     * 查询实时数据采集（小）
     *
     * @param TerminalID 实时数据采集（小）主键
     * @return 实时数据采集（小）
     */
    public RealtimegatherdataXb selectRealtimegatherdataXbByTerminalID(String TerminalID);

    /**
     * 查询实时数据采集（小）列表
     *
     * @param realtimegatherdataXb 实时数据采集（小）
     * @return 实时数据采集（小）集合
     */
    public List<RealtimegatherdataXb> selectRealtimegatherdataXbList(RealtimegatherdataXb realtimegatherdataXb);

    /**
     * 新增实时数据采集（小）
     *
     * @param realtimegatherdataXb 实时数据采集（小）
     * @return 结果
     */
    public int insertRealtimegatherdataXb(RealtimegatherdataXb realtimegatherdataXb);

    /**
     * 批量新增
     * @param list
     */
    public void batchinsertRealtimegatherdataXb(List<RealtimegatherdataXb> list);

    /**
     * 修改实时数据采集（小）
     *
     * @param realtimegatherdataXb 实时数据采集（小）
     * @return 结果
     */
    public int updateRealtimegatherdataXb(RealtimegatherdataXb realtimegatherdataXb);

    /**
     * 删除实时数据采集（小）
     *
     * @param TerminalID 实时数据采集（小）主键
     * @return 结果
     */
    public int deleteRealtimegatherdataXbByTerminalID(String TerminalID);

    /**
     * 批量删除实时数据采集（小）
     *
     * @param TerminalIDs 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteRealtimegatherdataXbByTerminalIDs(String[] TerminalIDs);

    List<RealtimegatherdataXb> selectRealtimegatherdataXbList2(RealtimegatherdataXb realtimegatherdataXb);
    List<RealtimegatherdataXb> selectList(RealtimegatherdataXb realtimegatherdataXb);

    List<WXRealtimegatherdataXb> selectWXRealtimegatherdataXbList(@Param("terminalId") String terminalId,@Param(("startTime")) String startTime, @Param("endTime") String endTime);

    /**
     * 根据terminalId和tenantId查找户表实时数据
     *
     * @param terminalId 设备编号
     * @param tenantId   客户编号
     * @return 户表实时数据
     */
    RealtimegatherdataXb selectRealtimeDataByTerminalIdAndTenantId(@Param("terminalId") String terminalId, @Param("tenantId") String tenantId);
}
